#!/usr/bin/env bash
# diff
liquibase \
--changeLogFile=dbchangelog.xml \
--classpath=/Users/wangbin/Downloads/mysql.jar \
--url="jdbc:mysql://localhost:3307/testdb" \
--username=root \
--password=root \
diffChangeLog \
--referenceUrl="jdbc:mysql://localhost:3306/testdb" \
--referenceUsername=root \
--referencePassword=root
# update
liquibase \
--changeLogFile=dbchangelog.xml \
--classpath=/Users/wangbin/Downloads/mysql.jar \
--url="jdbc:mysql://localhost:3307/testdb" \
--username=root \
--password=root \
update
# generate doc
liquibase \
--changeLogFile=dbchangelog.xml \
--classpath=/Users/wangbin/Downloads/mysql.jar \
--url="jdbc:mysql://localhost:3307/testdb" \
--username=root \
--password=root \
dbDoc \
doc

# rollback define tag
liquibase \
--classpath=/Users/wangbin/Downloads/mysql.jar \
--url="jdbc:mysql://localhost:3307/testdb" \
--username=root \
--password=root \
tag 1
# rollback to tag
liquibase \
--changeLogFile=dbchangelog.xml \
--classpath=/Users/wangbin/Downloads/mysql.jar \
--url="jdbc:mysql://localhost:3307/testdb" \
--username=root \
--password=root \
rollback 2


# generate sql
liquibase \
--changeLogFile=dbchangelog.xml \
--outputFile=dbchangelog.sql \
--classpath=/Users/wangbin/Downloads/mysql.jar \
--url="jdbc:mysql://localhost:3307/testdb" \
--username=root \
--password=root \
updateSQL